struts-<html:select>显示数据库值问题

来源:百度知道 编辑:UC知道 时间:2024/09/13 00:29:46
后台servlet:
Vector options = new Vector();
while (results.next()) {
options.add(new LabelValueBean(results.getString(1),results.getString(1)));
}
request.setAttribute ("options", options);

把从数据库里得到的一列发送到前台jsp

前台jsp得到options数组:
<%
Vector options=(Vector)request.getAttribute("options") ;
%>
但是我得到后始终无法显示到:
<html:select property="options">

<html:options collection="${options}" labelProperty="value" property="label"/>

</html:select>
这里<html:select>标签是怎么写呢,才能显示出数据库的数据.各位大侠,救救小弟吧.55555...先谢过了.

<html:options collection="options" labelProperty="value" property="label"/>
直接把属性范围里的options写到collection属性中就可以,不需要单独取出使用EL表达式

options不是一个值,${options.属性值}